1. Field of the Invention
The invention generally relates to an interpolation system and method, and in particular relates to an interpolation system and method applicable to image process of data size change.
2. Related Art
As technologies being advanced, digital cameras are replacing conventional cameras as a major tool of photography. After taking pictures, the image data can be transferred from the camera to a computer or the like, and outputted through a printer or a multi-function printer. The size of image output can be modified (enlarged or reduced) according to user's needs. In comparison to conventional image development, the modern digital process through image processing and printing is much more convenient for users.
Taking a screen image for example. The image on the screen is composed of matrix of pixels. Each pixel has at least a grayscale value to represent its color parameters. When enlarging an image, the distances between pixels are multiplied with an enlargement ratio so as to locate the new pixels. As shown in FIG. 1, the original image in the left of 2 plus 2 pixels is enlarged into an image of 4 plus 4 pixels by an enlargement ratio of 2. However, the simple enlargement of pixel distance generates some gaps in the matrix. Only the pixels in the correspondent positions carry the grayscale values. Therefore, the enlarged image loses fidelity.
Therefore, someone applies interpolation to determine the grayscale values of pixels in different positions after enlargement. For example, as shown in FIG. 2, supposed the grayscale values of four pixels A, B, C and D are P1, P2, P3 and P4. Then, the grayscale value of a pixel P among the four pixels can be determined through linear interpolation by the following equation:
                                 P          =                    ⁢                                    dxdyP              1                        +                                          (                                  1                  -                  dx                                )                            ⁢                              dyP                2                                      +                                          dx                ⁡                                  (                                      1                    -                    dy                                    )                                            ⁢                                                          ⁢                              P                3                                      +                                          (                                  1                  -                  dx                                )                            ⁢                              (                                  1                  -                  dy                                )                            ⁢                                                          ⁢                              P                4                                                                                  =                    ⁢                                                    [                                                                            dxdy                                                                                                                (                                                      1                            -                            dx                                                    )                                                ⁢                        dy                                                                                                            dx                        ⁡                                                  (                                                      1                            -                            dy                                                    )                                                                                                                                                              (                                                      1                            -                            dx                                                    )                                                ⁢                                                  (                                                      1                            -                            dy                                                    )                                                                                                                    ]                            ⁡                              [                                                                                                    P                        1                                                                                                            P                        2                                                                                                            P                        3                                                                                                            P                        4                                                                                            ]                                      T                                                        =                    ⁢                                    M              ⁢                                                          [                                                                                          P                      1                                                                                                  P                      2                                                                                                  P                      3                                                                                                  P                      4                                                                                  ]                        T                              
From the above equation, we can see that the grayscale value of pixel P is most influenced by the grayscale value of the nearest pixel. Other interpolation methods can be applied to determine the greyscale values of pixels P.
Conventionally the interpolation process to determine greyscale values of pixels are made by hardware of multipliers and adders. The hardware is more expensive. Further, the processing time of the hardware is longer when executing a more complicated interpolation.
For a specific interpolation process, the logic operation algorithm is made into an application specific integrated circuit (ASIC). To process a different interpolation process, a new ASIC with that operation algorithm is then required. It is costly and inconvenient to users.